﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WLWZGao6.APItitlion.IService;
using WLWZGao6.Domain.Common;
using WLWZGao6.Domain.Model;
using WLWZGao6.Domain.Dto;
using System.Collections.Generic;

namespace WLWZGao6.APIHost.Controllers
{
    /// <summary>
    /// 权限控制器
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class PermController : ControllerBase
    {
        /// <summary>
        /// 角色服务接口
        /// </summary>
        public IRoleService _roleService;
        /// <summary>
        /// 用户服务接口
        /// </summary>
        public IUserService _userService;
        /// <summary>
        /// 接口实现
        /// </summary>
        /// <param name="userService"></param>
        /// <param name="roleService"></param>
        public PermController(IUserService userService, IRoleService roleService)
        {
            _userService = userService;
            _roleService = roleService;
        }
        /// <summary>
        /// 递归权限显示
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public List<PermDto> PermShow()
        {
            return _roleService.PermShow();
        }
    }
}
